import service from '../utils/request';

const sendCodeApi = async (Form) => {
  try {
    const response = await service.post('/api/user/code', Form);
    return response;
  } catch (error) {
    console.error('Error adding student:', error);
    throw error;
  }
}

const loginApi = async (Form) => {
  try {
    const response = await service.post('/api/user/login', Form);
    return response;
  } catch (error) {
    console.error('Error adding student:', error);
    throw error;
  }
}

const registerApi = async (Form) => {
  try {
    const response = await service.post('/api/user/register', Form);
    return response;
  } catch (error) {
    console.error('Error adding student:', error);
    throw error;
  }
}

export { sendCodeApi, loginApi, registerApi };